<%@page import="com.crm.entity.Sources,java.util.*,com.crm.entity.Business" %>
<%@page import="com.crm.beans.QuotParts"%>
<%@page import="com.crm.entity.Supplier"%>
<% Business bus=(Business)session.getAttribute("business");%>
<%
String address=null;
if(request.getAttribute("address")!=null){
	address=request.getAttribute("address").toString();
}
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td align="right" valign="middle">&nbsp;</td>
              <td align="right" valign="middle">&nbsp;</td>
              <td align="right" valign="middle">&nbsp;</td>
              <td align="right" valign="middle">&nbsp;</td>
              <td align="right" valign="middle">&nbsp;</td>
              <td align="left" valign="middle">&nbsp;</td>
              <td align="left" valign="middle">&nbsp;</td>
            </tr>
            <tr>
              <td width="20%" align="left" valign="middle">Reference Number</td>
              <td width="23%" align="left" valign="middle"><input name="pidate" id="datepicker2" type="text" class="form" value=""/></td>
              <td width="7%" align="right" valign="middle">&nbsp;</td>
              <td align="left" valign="middle">Proforma Invoice Number</td>
              <td align="left" valign="top"><input name="pinum" type="text" class="form"  id="pinumid" value="<%=request.getAttribute("piNo") %>" /></td>
              <td width="1%" align="left" valign="middle">&nbsp;</td>
              <td width="10%" align="left" valign="middle"></td>
            </tr>
            <tr>
              <td height="5" align="left"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="middle"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
            </tr>
            <tr>
              <td height="5" align="left"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="middle"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
            </tr>
            <tr>
              <td align="left" valign="middle">Supply Order Number</td>
              <td align="left" valign="top"><label>
                <input name="sonumber" value="<%=request.getAttribute("soNo") %>" type="text" class="form" id="textfield" />
              </label></td>
              <td align="left" valign="middle">&nbsp;</td>
              <td align="left" valign="middle">Proforma Invoice Date</td>
              <td align="left" valign="top"><input name="pidate" value="<%=request.getAttribute("piDate") %>" id="datepicker2" type="text" class="form" value=""/></td>
              <td align="left" valign="top">&nbsp;</td>
              <td align="left" valign="middle">&nbsp;</td>
            </tr>
            <tr>
              <td height="5" align="left"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="middle"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
            </tr>
            <tr>
              <td height="5" align="left"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="middle"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
            </tr>
            <tr>
              <td align="left" valign="middle">Supply Order Start Date</td>
              <td align="left" valign="top"><input name="sodate" value="<%=request.getAttribute("soStartDate") %>" id="datepicker1" type="text" class="form" value=""/></td>
              <td align="left" valign="middle">&nbsp;</td>
              <td align="left" valign="middle">Supplier Order EndDate</td>
              <td align="left" valign="top"><input name="soedate" value="<%=request.getAttribute("soEndDate") %>" id="soedate" type="text" class="form" value=""/></td>
              <td align="left" valign="top">&nbsp;</td>
              <td align="left" valign="middle">&nbsp;</td>
            </tr>
                  <tr>
              <td height="5" align="left"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="middle"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
            </tr>
                     <tr>
              <td height="5" align="left"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="middle"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
            </tr>
                  <tr>
              <td height="10" align="left" valign="top">Supply Order Copy</td>
              <td height="10" align="left" valign="top">  <div class="uploadmain" id="socdiv" onclick="getFile()">Click to upload a file</div>
						<div style='height: 0px;width: 0px; overflow:hidden;'>
                      <input id="upfile"  name="sordercopy" type="file" value="upload" onchange="sub(this)"/>
                    </div></td>
              <td align="left" valign="middle">&nbsp;</td>
              <td align="left" valign="middle">&nbsp;</td>
              <td align="left" valign="middle">&nbsp;</td>
              <td align="left" valign="top">&nbsp;</td>
              <td align="left" valign="middle">&nbsp;</td>
            </tr>
          </table>
  <table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#C5E4EB">
          <tr>
            <td width="30" align="center" valign="middle" background="images/table-box.jpg"  style="background-repeat:repeat-x">S.No </td>
            <td width="111" align="center" valign="middle" background="images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Part number</td>
            <td width="111" align="center" valign="middle" background="images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Description</td>
            <td width="103" align="center" valign="middle" background="images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF"> Qty</td>
            <td width="118" align="center" valign="middle" background="images/table-box.jpg"  style="background-repeat:repeat-x bgcolor="#FFFFFF">Unit Price</td>
            <td width="148" align="center" valign="middle" background="images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Discount(%)</td>
            <td width="118" align="center" valign="middle" background="images/table-box.jpg"  style="background-repeat:repeat-x bgcolor="#FFFFFF">Unit Price After Discount</td>
            <td width="143" align="center" valign="middle" background="images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Price after discount</td>
          </tr>
          
          <%
List<QuotParts> qplist=(List<QuotParts>)request.getAttribute("quotpartslist");
        String  tdate=(String)request.getAttribute("curdate");
System.out.println("Jsp Result of partslist  "+request.getAttribute("quotpartslist"));
System.out.println("the list of parts in jsp  "+qplist);
%>
          <% if(qplist.size()>0 && qplist!=null){
             for(int i=0;i<qplist.size();i++){
             %>
            
          <tr>
            <td align="center" bgcolor="#FFFFFF"> 
            <input type="hidden" value="<%=qplist.size() %>" name="rowcount" id="rowcountid"/>
            <input name="sno<%=i %>" value="<%=i+1 %>" type="text" size="5" /></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="partid<%=i %>" id="partid<%=i %>"  value="<%=qplist.get(i).getPartNo()%>" type="hidden" size="5" /><input name="partno<%=i %>" id="partno<%=i %>"  value="<%=qplist.get(i).getPartNo()%>" type="text" size="5" /></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="desc<%=i %>" id="desc<%=i %>"  value="<%=qplist.get(i).getDesc()%>" type="text" size="5" /></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="qty<%=i %>" id="qtyid<%=i %>" value="<%=qplist.get(i).getQty() %>" type="text" size="5" /></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="uprice<%=i %>" id="upriceid<%=i %>" value="<%=qplist.get(i).getUnitPrice()%>" type="text" size="5" /></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="discount<%=i %>"  id="discountid<%=i %>" value="<%=qplist.get(i).getDesc() %>" type="text" size="5" /></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="upricedisc<%=i %>" id="upricediscid<%=i %>" value="<%=qplist.get(i).getUnitValue() %>" type="text" size="5" /></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="padiscount<%=i %>" id="padisid<%=i %>"  value="<%=qplist.get(i).getTotalcost()%>" type="text" size="5" /></td>
          </tr>
     <%}
             }%>
  </table>
  <table width="100%">
<tr><td>&nbsp;</td></tr>
<tr>
  <td align="left" valign="top" width="40%"><table border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td align="left" valign="top">Billing Address:</td>
      <td width="316" align="left" valign="top">Shipping Address:</td>
      <td width="32" align="left" valign="top">&nbsp;</td>
      <td width="461">Terms and Conditions</td>
      <td width="31" align="left" valign="top">&nbsp;</td>
    </tr>
    <tr>
      <td align="left" valign="top"><textarea name="billto" class="form-textarea"><%=address%></textarea></td>
      <td align="center" valign="top"><textarea  name="shipto" class="form-textarea"><%=address%></textarea></td>
      <td align="left" valign="top">&nbsp;</td>
      <td><textarea rows="5" cols="58" name="termsAndConditions"><%=bus.getTandc() %></textarea></td>
      <td align="left" valign="top">&nbsp;</td>
    </tr>
    <tr><td>&nbsp;</td></tr>
    <tr>
<td align="left" width="" valign="middle">
<table><tr><td  height="100px" align="center" width="110px" valign="top">BankGuarntee:</td>
<td height="60px" align="center" width="110px" valign="top"><input type="checkbox" value="" name="bgcheck" id="bgcheck"/></td></tr></table> </td>
<td colspan="3" align="left" valign="top" >
<div id="bgdiv" >
<table width="400">
  
  <tr><td width="121">Given Date:</td>
  <td width="267"><input type="text"  value="<%=request.getAttribute("bgdate") %>" style="width: 150px" class="form" name="bgdate" id="bgdate"/></td></tr>
<tr><td>End Date:</td><td><input type="text" value="<%=request.getAttribute("bgedate") %>" style="width: 150px" class="form" name="bgedate" id="bgedate"/></td></tr>
<tr>
  <td>Bank Copy:</td>
  <td><div class="upload" id="bcdiv" onclick="getbankFile()">Click to upload a file</div>
						<div style='height: 0px;width: 0px; overflow:hidden;'>
                      <input id="bankfile" type="file" name="bankcopy" value="upload" onchange="sub1(this)"/>
                    </div></td>
</tr>
</table>
</div></td>
    </tr>
<tr>
<td align="left" width="" valign="middle">
<table><tr><td align="center"  height="100px"  width="110px" valign="top">Warranty:&nbsp;</td>
<td height="60px" align="center" width="110px" valign="top"> <input type="checkbox" value="" name="warcheck" id="warcheck"/></td></tr></table></td>
<td colspan="3" align="left" valign="top">
<div id="wardiv">
<table width="400"><tr><td width="121">Given Date:</td>
<td><input type="text" value="<%=request.getAttribute("wargdate") %>" style="width: 150px"  class="form" name="wargdate" id="wargdate"/></td></tr>
<tr><td>End Date:</td><td><input type="text" value="<%=request.getAttribute("waredate") %>"  class="form"  style="width: 150px" name="waredate" id="waredate"/></td></tr>
<tr>
  <td>Warranty Copy:</td>
  <td> <div class="upload"  id="wcdiv" onclick="getwarFile()">Click to upload a file</div>
						<div style='height: 0px;width: 0px; overflow:hidden;'>
                      <input id="warfile" type="file" name="warcopy" value="upload" onchange="sub2(this)"/>
                    </div> </td>
</tr>
</table>
</div>
</td>
<td align="left" valign="top">&nbsp;</td>
      <td align="left" valign="top">&nbsp;</td>
    </tr>
    
<tr><td align="center"></td></tr>

</table>
</td></tr></table>